﻿@model NOSDC.Areas.Admin.Models.EventsCreateViewModel

@{
    ViewBag.Title = "Update";
}
<link href="../../../../Content/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/ckeditor/ckeditor.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-timepicker.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Edit Event - @Model.Events.Title</legend>

 <div class="editor-label">
            @Html.HiddenFor(model => model.Events.EventID)
            @Html.LabelFor(model => model.Events.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Events.Title)
            @Html.ValidationMessageFor(model => model.Events.Title)
        </div>

      
        <div class="editor-label" style="clear: both;">
            <strong>@Html.LabelFor(model => model.Events.Description)</strong> * <span style="color: green; font-style: italic; text-decoration: underline;">
            Be careful adding HTML to the page. Make sure you check the front page to ensure that your html did not break it.</span>
        </div>
         <div class="editor-field">
            @Html.TextAreaFor(model => model.Events.Description, new { @class = "ckeditor", style = "width:620px;height:150px;", id = "editor1", name = "Description" })
            @Html.ValidationMessageFor(model => model.Events.Description)
        </div>


        <div class="editor-label">
            @Html.LabelFor(model => model.Events.StartDate)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Events.StartDate, String.Format("{0:d}", Model.Events.StartDate.ToShortDateString()))
            @Html.ValidationMessageFor(model => model.Events.StartDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Events.EndDate)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Events.EndDate, String.Format("{0:d}", Model.Events.StartDate.ToShortDateString()))
            @Html.ValidationMessageFor(model => model.Events.EndDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Events.Location)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Events.Location)
            @Html.ValidationMessageFor(model => model.Events.Location)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Events.Price)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Events.Price)
            @Html.ValidationMessageFor(model => model.Events.Price)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Events.Logo)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.Events.Logo, Model.Logos, new { style="width:200px;" })
        </div>

        <div class="editor-label">
            <strong>Status</strong>
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.Events.StatusID, Model.StatusValues, new { style = "width:200px;" })
        </div>
        <div style="padding:10px;">
            <div>Select a sponsor for this event</div>
            <div>
               @for (var i = 0; i < Model.SponsorCheckList.Count(); i++ ){
                    <span style="padding-right:10px; ">
                    @Html.CheckBoxFor(s => s.SponsorCheckList[i].Checked)
                    @Model.SponsorCheckList[i].Name
                    @Html.HiddenFor(s => s.SponsorCheckList[i].ID)
                    </span>
               }
            </div>
        </div>
         <div style="padding:10px;">
            <div>Select a speaker for this event</div>
            <div>
               @for (var i = 0; i < Model.SpeakerCheckList.Count(); i++ ){
                    <span style="padding-right:10px; ">
                    @Html.CheckBoxFor(s => s.SpeakerCheckList[i].Checked)
                    @Model.SpeakerCheckList[i].Name
                    @Html.HiddenFor(s => s.SpeakerCheckList[i].ID)
                    </span>
               }
            </div>
        </div>
        <p>
            <input type="submit" value="Update Event" />
        </p>
    </fieldset>
}
<script type="text/javascript">
    $(function () {
        $("#Events_StartDate").datetimepicker({ showButtonPanel: true });
        $("#Events_EndDate").datetimepicker({ showButtonPanel: true });
    });
</script>
<div>
    @Html.ActionLink("Back to List", "Index")
</div>

